<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../../../lib/html5shiv.js?rev=@@hash"></script>
    <script type="text/javascript" src="../../../lib/respond.min.js?rev=@@hash"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="../../../lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="../../../lib/Validform/5.3.2/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../../ht-css/Project.css"/>
    <!--引入分页-->
    <link rel="stylesheet" href="../../../lib/pagination/pagination.css">
    <!--[if IE 6]>
    <script type="text/javascript" src="../../../lib/DD_belatedPNG_0.0.8a-min.js?rev=@@hash"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../../ht-css/style-q.css"/>
    <link rel="stylesheet" href="../../../ht-css/combo.select.css">
    <link rel="stylesheet" href="../../../lib/select2-4.0.3/dist/css/select2.min.css">
    <title>商品管理</title>
    <style>
        .relation {
            background: #FFFFFF;
            border: 1px solid #00a0e9;
        }

        .relation li {
            line-height: 2;
        }

        .relation li:hover {
            background: #00a0e9;
            color: #FFFFFF;
        }

        .guanlian {
            position: absolute;
            top: 35px;
            width: 100%;
            overflow-y: scroll;
            max-height: 150px;
            display: none;
        }

        .guanlian li {
            text-indent: 20px;
        }

        .pagination li {
            float: left;
            margin-left: 5px;
            width: 26px;
            height: 26px;
            border: 1px solid #ccc;
            text-align: center;
            color: #666;
        }

        .pagination li:hover {
            background-color: #5a98de;
        }

        .pagination li:hover a {
            color: #fff;
        }

        .dis_btn {
            background: #9c9a9a;
            color: #fff;
            border: 1px solid #9c9a9a;
        }

        .dis_btn:hover {
            background: #9c9a9a;
            color: #fff;
            border: 1px solid #9c9a9a;
        }

        .select2-container{
            width: 180px !important;
            float: left;
            margin-left: 10px;
            text-align: left;
        }

    </style>
</head>
<body data-id="505">
<nav class="breadcrumb">对接平台管理 <span class="c-gray en">&gt;</span> 渠道商品管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i
        class="Hui-iconfont">&#xe68f;</i></a></nav>
<article class="page-container">
    <div class="ml-20 mr-20" id="form-member-add" method="post">
        <div id="tab_topnav" class="HuiTab">
            <div><button class="btn radius size-S">渠道商品管理</button><button class="btn radius size-S" onclick="lincai()">临采商品管理</button></div>
            <!--商品售卖管理-->
            <div class="tabCon bg-1 bk-gray pb-10" id="productManage">
                <form class="lh-20 pd-10 classForm" name="">
                    <table class="table_li mb-10 table">
                        <thead class="text-l">
                        <tr>
                            <td class="col-4-1">
                                <div class="row ml-10">
                                    <label class="form-label f-l w-75 text-r lh-26">选择渠道商：</label>
                                        <select class="select" name="brandclass" id="quyu" size="1" >
                                            <option value="0" selected>请选择</option>
                                        </select>
                                </div>
                            </td>
                            <td class="col-4-1">
                                <div class="row ml-10">
                                    <label class="form-label f-l w-75 text-r lh-26">区域：</label>
                                    <span class="select-box size-M radius col-xs-8 ml-10" style="width:60%">
                                        <select class="select" name="receiver_province" id="getArea" size="1">
                                            <option value="0" selected>请选择区域</option>
                                        </select>
                                    </span>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3" class="col-1-1">
                                <div class="row ml-10">
                                    <label class="form-label f-l w-75 text-r lh-26">商品分类：</label>
                                    <span class="size-M radius col-xs-8 f-l" style="width:20%">
                                       <div style="position: relative;z-index: 900;">
                                            <input type="text" autocomplete="off" class="input-text radius"
                                                   name="class1" placeholder="请选择一级分类" oninput="goods_listCategory(1)"
                                                   id="class1" datatype="*0-20" errormsg="格式错误，请重新输入" ignore="ignore">
                                            <ul class="relation radius guanlian" id="classUl1">

                                            </ul>
                                        </div>
                                        <!--<span class="Validform_checktip"></span>-->
                                    </span>
                                    <span class="f-l pl-10 pr-10 pt-5">~</span>
                                    <span class="size-M radius col-xs-8 f-l" style="width:20%">
                                        <div style="position: relative;z-index: 900;">
                                            <input type="text" autocomplete="off" class="input-text radius"
                                                   name="class2" placeholder="请选择二级分类" id="class2" datatype="*0-20"
                                                   errormsg="格式错误，请重新输入" ignore="ignore">
                                            <ul class="relation radius guanlian" id="classUl2">
                                            </ul>
                                        </div>
                                        <!--<span class="Validform_checktip"></span>-->
                                    </span>
                                    <span class="f-l pl-10 pr-10 pt-5">~</span>
                                    <span class="size-M radius col-xs-8" style="width:20%">
                                        <div style="position: relative;z-index: 900;">
                                            <input type="text" autocomplete="off" class="input-text radius"
                                                   name="class3" placeholder="请选择三级分类" id="class3" datatype="*0-20"
                                                   errormsg="格式错误，请重新输入" ignore="ignore">
                                            <ul class="relation radius guanlian" id="classUl3">
                                            </ul>
                                        </div>
                                        <!--<span class="Validform_checktip"></span>-->
                                    </span>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="col-4-1">
                                <div class="row ml-10">
                                    <label class="form-label f-l w-75 text-r lh-26">SPU码：</label>
                                    <div class="formControls f-l">
                                        <input type="text" class="input-text radius ml-10 w-180" name="spu_code" id="spu_code"
                                               placeholder="输入SPU码" datatype="n0-11" errormsg="格式错误，请重新输入"
                                               ignore="ignore">
                                    </div>
                                    <!--<span class="Validform_checktip"></span>-->
                                </div>
                            </td>
                            <td class="col-4-1">
                                <div class="row ml-10">
                                    <label class="form-label f-l lh-26 w-75 text-r">运营负责人：</label>
                                    <div class="formControls f-l">
                                        <input type="text" class="input-text radius ml-10 w-180" name="salesManParam"
                                               id="salesManParam"
                                               placeholder="输入采销负责人工号/姓名关键字"
                                               datatype="/^[a-zA-Z0-9\u4e00-\u9fa5]{0,20}$/" errormsg="格式错误，请重新输入"
                                               ignore="ignore">
                                    </div>
                                    <!--<span class="Validform_checktip"></span>-->
                                </div>
                            </td>
                            <td style="width:30%">
                                <div class="row ml-10">
                                    <label class="form-label f-l w-75 text-r lh-26">Code码：</label>
                                    <div class="formControls f-l">
                                        <input type="text" class="input-text radius ml-10 w-150" name="Code" id="sku_code"
                                               placeholder="输入Code码" datatype="*0-15"  errormsg="格式错误，请重新输入"
                                               ignore="ignore">
                                    </div>
                                    <!--<span class="Validform_checktip"></span>-->
                                </div>
                            </td>
                            <td class="col-4-1">
                                <div class="row ml-10">
                                    <label class="form-label f-l lh-26 text-r w-60">助记码：</label>
                                    <div class="formControls f-l">
                                        <input type="text" class="input-text radius ml-10 w-150" name="helpcode" id="helpcode"
                                               placeholder="输入助记码" datatype="/^[^\u4e00-\u9fa5]{0,50}$/" errormsg="格式错误，请重新输入"
                                               ignore="ignore">
                                    </div>
                                    <!--<span class="Validform_checktip"></span>-->
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="col-4-1">
                                <div class="row ml-10">
                                    <label class="form-label f-l text-r w-75 lh-26">商品名称：</label>
                                    <div class="formControls f-l">
                                        <input type="text" class="input-text radius ml-10 w-180" name="goodsName" id="goodsName"
                                               placeholder="输入商品名称关键字" datatype="*0-30" errormsg="格式错误，请重新输入"
                                               ignore="ignore">
                                    </div>
                                    <!--<span class="Validform_checktip"></span>-->
                                </div>
                            </td>
                            <td class="col-4-1">
                                <div class="row">
                                    <label class="form-label f-l text-r w-60 lh-26 pl-25">商品别名：</label>
                                    <div class="formControls f-l">
                                        <input type="text" class="input-text radius ml-10 w-180" name="aliasParam" id="aliasParam"
                                               placeholder="输入商品别名关键字" datatype="/^[a-zA-Z0-9\u4e00-\u9fa5]{0,15}$/"
                                               errormsg="格式错误，请重新输入" ignore="ignore">
                                    </div>
                                    <!--<span class="Validform_checktip"></span>-->
                                </div>
                            </td>
                            <td style="width:30%">
                                <div class="row">
                                    <label class="form-label f-l text-r w-75 lh-26 pl-25">是否限制类：</label>
                                    <select class="select radius ml-10 f-l" style="width:48%;height:30px;"  id="isLimitCategory" name="isLimitCategory" size="1">
                                        <option value="-1" selected>---请选择---</option>
                                        <option value="0" >非限制类</option>
                                        <option value="1">危化品</option>
                                        <option value="2">管制刀具</option>
                                    </select>
                                </div>
                            </td>
                            <td class="col-4-1">
                                <div class="row">
                                    <label class="form-label f-l text-r w-60 lh-26 pl-25">商品标准：</label>
                                    <select class="select radius ml-10 f-l" style="width:48%;height:30px;" id="spuStandards" name="spuStandards" size="1">
                                        <option value="0">---请选择---</option>
                                        <option value="1">国标有标准号</option>
                                        <option value="2">国标</option>
                                        <option value="3">无标准有下差</option>
                                        <option value="4">无标准无下差</option>
                                        <option value="5">其它</option>
                                    </select>
                                </div>
                            </td>

                        </tr>
                        <tr>
                            <td class="col-4-1">
                                <div class="row ml-10">
                                    <label class="form-label f-l w-75 text-r lh-26">品牌：</label>
                                    <div class="formControls f-l">
                                        <input type="text" class="input-text radius ml-10 w-180" name="brandName" id="brandName"
                                               placeholder="输入品牌关键字" datatype="/^[a-zA-Z0-9\u4e00-\u9fa5]{0,15}$/"
                                               errormsg="格式错误，请重新输入" ignore="ignore"/>
                                    </div>
                                    <!--<span class="Validform_checktip"></span>-->
                                </div>
                            </td>
                            <td class="col-4-1">
                                <div class="row ml-10" align="left">
                                    <label class="form-label f-l text-r w-60 lh-26">创建时间：</label>
                                    <div class="formControls f-l">
                                        <input class="workinput wicon input-text radius ml-10" id="creationDateBegin" type="text"
                                               placeholder="起始时间" style="width:81px;" readonly>
                                        ~
                                        <input class="workinput wicon input-text radius" id="creationDateEnd" type="text"
                                               placeholder="结束时间" style="width:81px;" readonly>
                                    </div>
                                    <!--<span class="Validform_checktip"></span>-->
                                </div>
                            </td>
                            <!--<td class="col-4-1 hide">
                                <div class="row">
                                    <label class="form-label f-l text-r w-60 lh-26 pl-25">锁价商品：</label>
                                    <select class="select radius ml-10 f-l price-locked-goods" style="width:48%;height:30px;" name="priceLockedGoods" size="1">
                                        <option value="0">-&#45;&#45;请选择-&#45;&#45;</option>
                                        <option value="1">全部</option>
                                        <option value="2">是</option>
                                        <option value="3">否</option>
                                    </select>
                                </div>
                            </td>-->
                            <!--<td class="col-4-1">-->
                            <!--<div class="row ml-10" align="left">-->
                            <!--<label class="form-label f-l text-r w-60 lh-26">推送时间：</label>-->
                            <!--<div class="formControls f-l">-->
                            <!--<input class="workinput wicon input-text radius ml-10" id="pushDownDateBegin" type="text"-->
                            <!--placeholder="起始时间" style="width:140px;" readonly>-->
                            <!--~-->
                            <!--<input class="workinput wicon input-text radius" id="pushDownDateEnd" type="text"-->
                            <!--placeholder="结束时间" style="width:140px;" readonly>-->
                            <!--</div>-->
                            <!--&lt;!&ndash;<span class="Validform_checktip"></span>&ndash;&gt;-->
                            <!--</div>-->
                            <!--</td>-->
                        </tr>
                        </thead>
                    </table>
                    <div class="text-c pb-20 pt-10">
                        <input type="submit" class="btn radius size-S ml-10 powerButton 606" value="查&nbsp;&nbsp;询">
                        <input name="form1" type="reset" onclick="resetDiv()" class="btn radius size-S ml-10 powerButton 606"
                               value="重&nbsp;&nbsp;置">
                    </div>
                </form>
                <div>
                    <input name="" type="button" onclick="exportExcelFn()" class="btn radius size-S ml-10" value="对接失败商品导出">
                    <input name="" type="button" onclick="oilConversionRate()" class="btn radius size-S ml-10" value="成品油转化率维护">
                    <input type="button" class="btn radius size-S ml-10 powerButton 606" onclick="exportPriceLockedGoodsFn()" value="导出锁价商品">
                    <input name="form1" type="button" onclick="importPriceLockedGoodsFn()" class="btn radius size-S ml-10 powerButton 606" value="管理锁价商品">
                    <input type="file" id="priceLockedGoodsFile" name="image" onchange="changeExcelFn(event)" hidden>
                    <a class="ml-10 powerButton 606" onclick="downloadExcelTemplateFn()" href="javascript:;">样表下载</a>
                </div>
                <table class="table table-border table-bg table-hover table-sort mt-10" id="datatable">
                    <thead>
                    <tr class="text-c">
                        <th width="80"><input type="checkbox" onclick="stopProp()" value="spu_all" id="spu_all">SPU码</th>
                        <th width="80">图片</th><!--新加fd-->
                        <th width="100">商品名称</th>
                        <th width="105">副标题</th><!--副标题fd-->
                        <th width="50">品牌</th>
                        <th width="60">SKU数量</th>
                        <th width="50">运营负责人</th>
                        <th width="50">上下架状态</th>
                        <th width="100">商品区域</th><!--售卖区域fd-->
                        <th width="50">创建时间</th><!--售卖区域fd-->
                        <!--<th width="50">推送时间</th>-->
                        <th width="50">操作</th>
                    </tr>
                    </thead>
                    <tbody class="shun">

                    </tbody>
                </table>
                <div class="dataTables_wrapper goods_fanye clearfix mt-10">
                    <div class="f-r pageturning M-box3"></div>
                </div>
            </div>

            <!--临采商品管理-->
            <!-- <div >
                 &lt;!&ndash;<div class="lh-20 pd-10">
                     <iframe align="left" width="1350" height="1570" src="procureGoodsManage.html" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
                 </div>&ndash;&gt;
             </div>-->
        </div>
    </div>
</article>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../../../lib/jquery/1.9.1/jquery.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/layer/2.4/layer.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/laypage/1.2/laypage.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../static/h-ui/js/H-ui.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../static/h-ui.admin/js/H-ui.admin.js?rev=@@hash"></script> <!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="../../../lib/My97DatePicker/4.8/WdatePicker.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/datatables/1.10.0/jquery.dataTables.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/laypage/1.2/laypage.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../ht-js/frame/doT.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/jquery.combo.select.js?rev=@@hash"></script>
<!--表单验证-->
<script type="text/javascript" src="../../../lib/Validform/5.3.2/Validform_v5.3.2_min.js?rev=@@hash"></script>
<script src="../../../lib/pagination/jquery.pagination.js?rev=@@hash"></script>
<script src="../../../ht-js/public.js?rev=@@hash"></script>
<!--验证token-->
<script src="../../../ht-js/verifyToken.js?rev=@@hash"></script>
<link rel="stylesheet" type="text/css" href="../../../ht-css/jedate.css" />

<!--时间组件-->
<script type="text/javascript" src="../../../lib/jquery.jedate.min.js?rev=@@hash"></script>
<script src="../../../ht-js/dockingplatform/goods/goodsList.js?rev=@@hash"></script>
<script src="../../../ht-js/dynamicWarehouse.js?rev=@@hash"></script>
<script src="../../../ht-js/warehouse.js?rev=@@hash"></script>
<!--权限控制-->
<script type="text/javascript" src="../../../ht-js/power.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/select2-4.0.3/dist/js/select2.full.min.js"></script>
<script>
    $(document).ready(function () {
            $('#quyu').select2({});
        });
    /*
配置内容下拉框的展示
 */
    function lincai(){
        var index = layer.open({
            type: 2,
            title: "临采商品管理",
            content: 'procureGoodsManage.html'
        });
        layer.full(index);

    }


    $(function () {
        $.ajax({
            type: "post",
            url: root.dockingplatform.allChannelConfig,
            cache: false,  //禁用缓存
            dataType: "json",
            data: {

            },
            //传入组装的参数
            success: function (data) {
                if(data.errorCode=="0") {
                    var dataInter=data.data;
                    var interText = doT.template($("#ascription_bob").text());
                    $.each(dataInter, function (inx, data2) {
                        var haha = '<option value="' + data2.customerId +'" >' + data2.customerName + '</option>';
                        $('#quyu').append(haha)
                    })
                }
            }
        })
    })



    function spu_add(title, url) {
        var index = layer.open({
            type: 2,
            title: title,
            content: url
        });
        layer.full(index);
    }

    /*删除添加spu图片的缓存，防止刷新页面后缓存不消失*/
    sessionStorage.removeItem("spuImgCache");
    sessionStorage.removeItem("brand_name");
    sessionStorage.removeItem("brand_id");
    sessionStorage.removeItem("attrObjCanch");
    sessionStorage.removeItem("attrId");

    /*tab切换*/
    jQuery.Huitab = function (tabBar, tabCon, class_name, tabEvent, i) {
        var $tab_menu = $(tabBar);
// 初始化操作
        $tab_menu.removeClass(class_name);
        $(tabBar).eq(i).addClass(class_name);
        $(tabCon).hide();
        $(tabCon).eq(i).show();
        $tab_menu.bind(tabEvent, function () {
            $tab_menu.removeClass(class_name);
            $(this).addClass(class_name);
            var index = $tab_menu.index(this);
            $(tabCon).hide();
            $(tabCon).eq(index).show()
        })
    }

    $(function () {
        $.Huitab("#tab_topnav .tabBar span", "#tab_topnav .tabCon", "current", "click", "0")
    });
    $(function () {
        $(".classForm").Validform({
            tiptype: 2,
            callback: function (form) {
                console.log($(".price-locked-goods").val());
                reloadSpuTable();
                return false;
            }
        });
    });
    $(function () {
        $("#picForm").Validform({
            tiptype: 2,
            callback: function (form) {
                img_list();
                return false;
            }
        });


        /*时间设置*/
        function timeSet(startEl, endEl, timeFormat) {
            /*startEl=>开始时间Input的id，endEl=>结束时间Input的id，时间格式（YYYY-MM-DD hh:mm:ss  YYYY年MM月DD日 hh:mm:ss）*/
            /*时间设置*/
            var thisMaxTime = $.nowDate().substring(0, $.nowDate().length - 8) + "23:59:59";
            var start = {
                format: timeFormat,
                maxDate: thisMaxTime,
                okfun: function (obj) {
                    end.minDate = obj.val.substring(0, obj.val.length - 5) + "00:00:00"; //开始日选好后，重置结束日的最小日期
                }
            };
            var end = {
                format: timeFormat,
                maxDate: thisMaxTime,
                okfun: function (obj) {
                    start.maxDate = obj.val.substring(0, obj.val.length - 5) + "23:59:59"; //将结束日的初始值设定为开始日的最大日期
                }
            };
            $.jeDate(startEl, start);
            $.jeDate(endEl, end);
        }
        timeSet("#creationDateBegin","#creationDateEnd","YYYY-MM-DD hh:mm:ss");
    });

    /*时间设置*/
    timeSet("#pushDownDateBegin","#pushDownDateEnd","YYYY-MM-DD hh:mm:ss");
    function timeSet(startEl, endEl, timeFormat) {
        /*startEl=>开始时间Input的id，endEl=>结束时间Input的id，时间格式（YYYY-MM-DD hh:mm:ss  YYYY年MM月DD日 hh:mm:ss）*/
        /*时间设置*/
        var thisMaxTime = $.nowDate()
        var start = {
            format: timeFormat,
            maxDate: thisMaxTime,
            okfun: function (obj) {
                end.minDate = obj.val //开始日选好后，重置结束日的最小日期
            }
        };
        var end = {
            format: timeFormat,
            maxDate: thisMaxTime,
            okfun: function (obj) {
                start.maxDate = obj.val //将结束日的初始值设定为开始日的最大日期
            }
        };
        $.jeDate(startEl, start);
        $.jeDate(endEl, end);
    }



</script>
</body>
</html>
